//
//  AboutUsController.m
//  PropertyMananger
//
//  Created by bh on 17/4/6.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "AboutUsController.h"

@interface AboutUsController ()
@property (nonatomic,strong) UILabel * contentLable;
@end

@implementation AboutUsController
- (void)viewWillAppear:(BOOL)animated
{
    
    [super viewWillAppear:animated];
    
 self.navigationController.navigationBar.hidden = NO;
    
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self initTitleViewName:@"关于我们"];
    
    [self createDetailUI];

    
    DLog(@"关于我们的描述 == %@",userModel.commitList.CommunityName);
    
}
- (void)createDetailUI{
    
    UIScrollView * scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(10, 10, BHscreenW-20, BHscreenH-64-20)];
    //    scrollView.layer.borderWidth = 0.5;
    //    scrollView.layer.borderColor = BHColor(102, 102, 102).CGColor;
    //    scrollView.backgroundColor = [UIColor whiteColor];
    //    scrollView.layer.cornerRadius = 5;
    scrollView.showsVerticalScrollIndicator = NO;
    scrollView.showsHorizontalScrollIndicator = NO;
    [self.view addSubview:scrollView];
    
    float w = scrollView.frame.size.width;
    
    if(userModel.listArr.count){
        
        CommunitylistModel * communtiyModel = userModel.listArr[0];
        DLog(@"%@",communtiyModel.companydescribe);
        
        
        NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[communtiyModel.companydescribe dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
        UITextView * textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, w, BHscreenH-64-20)];
        textView.attributedText = attrStr;
        textView.textColor = [UIColor grayColor];
        textView.font = [UIFont systemFontOfSize:15];
        textView.showsVerticalScrollIndicator = NO;
        textView.showsHorizontalScrollIndicator = NO;
        textView.userInteractionEnabled = NO;
        [scrollView addSubview:textView];
        CGSize size = [textView sizeThatFits:CGSizeMake(w, MAXFLOAT)];
        CGRect frame = textView.frame;
        frame.size.height = size.height;
        textView.frame = frame;
        float scorllViewH = CGRectGetMaxY(textView.frame);
        if(scorllViewH < BHscreenH-64-20){
            scrollView.frame = CGRectMake(10, 10, BHscreenH-20, scorllViewH);
        }
        scrollView.contentSize = CGSizeMake(w, scorllViewH);
        
    }
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
   
}

@end
